package com.asset.dispoal.extension;

import com.asset.dispoal.extension.api.PermissionExtensionService;
import com.asset.dispoal.extension.dto.PermissionRequest;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@RequestMapping("extension/permission/")
@Api(hidden = true)
public class PermissionExtensionController {

    @Autowired
    PermissionExtensionService permissionExtensionService;

    @GetMapping("/check")
    @ApiIgnore
    public String checkPermission(@ModelAttribute PermissionRequest permissionRequest) {
        return permissionExtensionService.checkPermission(permissionRequest);
    }
}
